import { createLoginUsername, createLoginPhone } from '@/content-scripts/components/login/login.js'
import { language } from '@/content-scripts/locales';

export function observeLoginElements() {
    const observer = new MutationObserver(() => {
        // console.log(mutations);

        const emailContainer = document.querySelector(`input.mantine-Input-input[placeholder="${language.originEmailPlace}"]`);
        // const phoneContainer = document.querySelector('.generic-id-input-container');
        // console.log(emailContainer, phoneContainer, 'eeeeeeerrrrrrrrrr');


        if (emailContainer) {
            createLoginUsername();
        } else {
            createLoginPhone();
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
}

